import { Map } from "immutable";
import * as actionTypes from "./constance";

const defaultState = Map({
  albums: [],
  albumComments: [],
  artistAlbum: [],
});

const a = (state = defaultState, action) => {
  switch (action.type) {
    case actionTypes.GET_ALBUM:
      return state.set("albums", action.topAlbums);
    case actionTypes.GET_ALBUMCOMMENT:
      return state.set("albumComments", action.albumComments);
    case actionTypes.GET_ARTISTALBUM:
      return state.set("artistAlbum", action.artistAlbum);
    default:
      return state;
  }
};

export default a;
